package ym.ecrm.web.action.systemManagement;

import org.springframework.beans.factory.annotation.Autowired;

import com.opensymphony.xwork2.ActionContext;

import ym.ecrm.core.common.exception.MessageException;
import ym.ecrm.core.dto.systemManagement.UserDTO;
import ym.ecrm.core.service.systemManagement.ISystemService;
import ym.ecrm.web.action.base.BaseAction;

/**
 * 
 * @author Princess
 * 
 */
public class GetUserNameAction extends BaseAction {

	String userName = "";
	
	@Autowired
	private ISystemService systemService;

	public String execute(){
		UserDTO user = (UserDTO) ActionContext.getContext().getSession().get("user");
		if(user != null){
			userName = user.getUserName();
			return proccess();
		}else{
			return processException(new MessageException("登录超时，请重新登录。"));
		}
	}
	
	public String getErrorMessage(){
		return errorMessage;
	}
	
	public String getSuccess(){
		return success;
	}
	
	public String getUserName(){
		return this.userName;
	}

}
